allWptNameLengths = 0;
if (rte->waypoint_list.next) { /* this test doesn't do what I want i.e test if this is a valid route - treat as a placeholder for now */
+ char *c;
+
QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
testwpt = (waypoint *)elem;
if (rte_datapoints == 0) {
else
rname = xstrdup(rte->rte_name);
- fprintf(psit_file, "Route: %s\n",
- rname);
+ /* check for psitrex comment sign; replace with '$' */
+ while ((c = strchr(rname, '#'))) *c = '$';
+
+ fprintf(psit_file, "Route: %s\n", rname);
xfree(rname);
}
}
trk_num = 0;
trk_count = 0;
+
+ track_head = NULL;
psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), wscomma);
psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), whitespace);
- if (strcmp(psit_current_token, "1") == 0) {
+ if ((strcmp(psit_current_token, "1") == 0) || (track_head == NULL)) {
track_head = route_head_alloc();
/* Add a number to the track name. With Garmins, the "first" tracklog is usually ACTIVE LOG
the second is ACTIVE LOG001 and so on */
/* total nodes (waypoints) this track */
trk_datapoints = 0;
if (trk->waypoint_list.next) { /* this test doesn't do what I want i.e test if this is a valid track - treat as a placeholder for now */
+ char *c;
+
QUEUE_FOR_EACH(&trk->waypoint_list, elem, tmp) {
if (trk_datapoints == 0) {
testwpt = (waypoint *)elem;
else
tname = xstrdup(trk->rte_name);
- fprintf (psit_file, "Track: %s\n",
- tname);
+ /* check for psitrex comment sign; replace with '$' */
+ while ((c = strchr(tname, '#'))) *c = '$';
+
+ fprintf (psit_file, "Track: %s\n", tname);
xfree(tname);
}